A compiler is a tool used to convert computer programs written in high level programming languages into machine code executed by one or more central processing units (CPUs) in a computer system. Depending upon how the compiler performs this conversion, the resulting program can execute at different speeds on the computer and/or can require more or less system memory and more or less storage space.
Much work has been done to create compilers which do more than create a direct translation from source code to machine code. Such compilers are typically referred to as optimizing compilers. Optimizing compilers analyze source code and implement strategies that can execute more efficiently on a target computer system. In this context, “optimizing” generally refers to improving the speed or efficiency of a computer program by selectively modifying how the source code is compiled.
While optimizing compilers can employ many techniques such as loop transformation or data remapping to produce efficient machine code, advances in computer hardware have introduced new challenges to compiler designers. Specifically, the clock speed of CPU devices has undergone an increase in recent years, while system memory speeds have lagged behind. Unmanaged, this speed discrepancy (typically referred to as memory latency) causes the CPU to wait idly while data is read from or written to system memory. One optimization strategy used in compilers is to improve cache utilization (and thereby execution time) and reduce the number of cache misses that occur during program execution.